<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<fmt:bundle
	basename="br.com.universidade.castelo.branco.resources.ApplicationResources"
	prefix="">
<head>
	<link rel="stylesheet" type="text/css" href="resources/js/jquery/apprise.css" />
	<script src="resources/js/jquery/jquery-1.4.4.min.js"></script>
	<script src="resources/js/jquery/apprise-1.5.full.js"></script>
	
	<link rel="stylesheet" href="resources/js/jquery/jquery-ui.css" />
	<script src="resources/js/jquery/jquery-1.9.1.js"></script> 
	<script src="resources/js/jquery/jquery-ui.js"></script>
	
<script type="text/javascript">

function chamaExcluirColaborador(id_colaborador){
$(function() {
    $( "#dialog-confirmaExclusao" ).dialog({
      resizable: false,
      height:140,
      modal: true,
      buttons: {
        "OK": function() {
        	$( this ).dialog( "close" );
        	excluirColadorador(id_colaborador);
        },
        "Cancelar": function() {
          $( this ).dialog( "close" );
        }
      }
    });
  });
}  
  
function excluirColadorador(id_colaborador){
		$.ajax({	
	        type: 'POST',  
	        url: 'excluiColaborador?id_colaborador=' + id_colaborador,  
	        success: function() {
	        	colaboradorExcluido();
	        }
	    });
}

function colaboradorExcluido(){
	window.location.href='colaboradorExcluido';
}
</script>
	
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="resources/css/formatos.css" />
</head>
	<body>

		<jsp:include
			page="/WEB-INF/views/pesquisadesatisfacao/colaborador/formularioConsultaColaborador.jsp"
			flush="false"></jsp:include>
			
			

		<img src="resources/imagens/pixel_transparente.gif" height="5%"
			width="10%">
		<div align="center">

			<fieldset id="fieldsetConsulta">

				<legend id="alinhamentoFormConsulta">
					<h3>
						<fmt:message key="consulta.modulo.colaborador.titulo"></fmt:message>
					</h3>
				</legend>


				<table class=linhasAlternadas align="center">

					<tr>
						
						<th><fmt:message key="consulta.modulo.colaborador.campo.nome"></fmt:message></th>
						<th><fmt:message
								key="consulta.modulo.colaborador.campo.email"></fmt:message></th>
						<th><fmt:message
								key="consulta.modulo.colaborador.campo.perfil"></fmt:message></th>
						<th><fmt:message key="consulta.modulo.colaborador.campo.area"></fmt:message></th>
						<th><fmt:message
								key="consulta.modulo.colaborador.campo.data.de.nascimento"></fmt:message></th>
						<th><fmt:message key="consulta.modulo.colaborador.campo.sexo"></fmt:message></th>
						<th><fmt:message
								key="consulta.modulo.colaborador.campo.matricula"></fmt:message></th>
						<th><fmt:message
								key="consulta.modulo.colaborador.campo.login"></fmt:message></th>
						<th><fmt:message
								key="consulta.modulo.colaborador.campo.senha"></fmt:message></th>
						<th><fmt:message
								key="consulta.modulo.colaborador.campo.alterar"></fmt:message></th>
						<th><fmt:message
								key="consulta.modulo.colaborador.campo.excluir"></fmt:message></th>
					</tr>

					<c:forEach items="${colaboradores}" var="colaborador">
						<tr>
							
							<td>${colaborador.nome}</td>
							<td>${colaborador.email}</td>
							<td>${colaborador.perfil}</td>
							<td>${colaborador.area}</td>
							<td><fmt:formatDate value="${colaborador.dataNasc}"/></td>
							<td>${colaborador.sexo}</td>
							<td>${colaborador.matricula}</td>
							<td>${colaborador.login}</td>
							<td>${colaborador.senha}</td>
							<td><a href="exibeColaborador?id_colaborador=${colaborador.id_colaborador}"><div class=imgAlterar></div></a></td>
							<td><a href="javascript:void(0)" onclick="chamaExcluirColaborador(${colaborador.id_colaborador})"><div class=imgExcluir></div></a></td>
						</tr>
					</c:forEach>
				</table>

			</fieldset>
			<table>
				<tr> 
					<td>  <div id="dialog-confirmaExclusao" title="Excluir" style="display: none;">
						<p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 1px 0;"></span><fmt:message key="pds.excluir"></fmt:message></p>
					</div>
					</td> 
				</tr> 
			</table>
		</div>
	</body>
</fmt:bundle>
</html>